#include <iostream>

using namespace std;

class Clock
{
public:
    Clock(int newH, int newM, int newS);   //构造函数原型声明
    void setTime(int newH, int newM, int newS);
    void showTime();

private:
    int hour, minute, second;
};

Clock::Clock(int newH, int newM, int newS):   //构造函数，函数名与类名完全相同，无返回值
    hour(newH), minute(newM), second(newS)
{
}

void Clock::showTime()
{
    cout << hour << " : " << minute << " : " << second << endl;
}

int main()
{
    Clock c(1,0,0);                          //自动调用构造函数，并自动初始化
    c.showTime();
    return 0;
}

